package com.dai.spec.common.enums;

/**
 * 审批状态枚举
 */
public enum ApprovalStatus {

    PENDING_APPROVAL("0", "待审批"),
    PASS_APPROVAL("1", "审批通过"),
    REFUSE_APPROVAL("2", "审批拒绝");

    private String code;
    private String value;

    ApprovalStatus(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }
    public  static String getValueByCode(String code){
        for (ApprovalStatus approvalStatusEnum : ApprovalStatus.values()) {
            if (approvalStatusEnum.getCode().equals(code)){
                return approvalStatusEnum.getValue();
            }
        }
        return null;
    }
}
